﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Trans.system
{
    public partial class Sys_backup : Form
    {
        public Sys_backup()
        {
            InitializeComponent();
        }

        private void bt_file_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog d = new FolderBrowserDialog();
            if(d.ShowDialog()==DialogResult.OK)
            {
                tx_file.Text = d.SelectedPath.ToString();
            }
        }

        private void bt_backup_Click(object sender, EventArgs e)
        {
            bt_backup.Text = "备份中...";
            try
            {


                sysAdapter.backup(tx_file.Text);
                MessageBox.Show(
                                "备份完成",
                                "",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
            }catch(Exception ee)
            {
                MessageBox.Show(
                                "备份失败"+ee.Message,
                                "",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
       
            
        }

        private void bt_cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
